package com.shxt.service.impl;

import java.util.List;
import java.util.Map;

import javax.servlet.http.HttpServletRequest;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.shxt.mapper.ClientMapper;
import com.shxt.model.Client;
import com.shxt.service.ClientService;
@Service
public class ClientServiceImpl implements ClientService {
    
    @Autowired
    private ClientMapper clientMapper;
    
    
    @Override
    public int delete(String client_ids ) {
        // TODO Auto-generated method stub
        String[] client_id = client_ids.split("-");
        int i =0;
        for(String idString : client_id){
            clientMapper.delete(Integer.parseInt(idString));
            i++;
        }





        return i;
    }
    
    @Override
    public int add(Client client ) {
        // TODO Auto-generated method stub
        return 0;
    }
    
    @Override
    public Client load(Integer cli_id ) {
        // TODO Auto-generated method stub
        return null;
    }
    
    @Override
    public int update(Client client ) {
        // TODO Auto-generated method stub
        return 0;
    }
    
    @Override
    public List<Client> clientList(Map<String , Object> map,HttpServletRequest request) {
        // TODO Auto-generated method stub



        return clientMapper.clientList(map);
    }

    @Override
    public Integer count(Map<String , Object> map ) {
        // TODO Auto-generated method stub
        return clientMapper.count(map);
    }
    
}
